package com.my.xinyidaixi.Adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by zw on 2017/6/7.
 */
public class TabFragmetPagerAdapter extends FragmentPagerAdapter {

    //Tab 适配器
    public Fragment tabFrams[];
    public String titles[];

    public TabFragmetPagerAdapter(FragmentManager fm, String[] tabTitles, Fragment[] tabFrames) {
        super(fm);
        this.titles=tabTitles;
        this.tabFrams=tabFrames;
    }

    @Override
    public Fragment getItem(int position) {
        return tabFrams[position];
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
